package com.zstu.mall.entity;

import com.zstu.mall.common.BaseEntity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.*;

/**
 * @author     : wuyc
 * @description: order
 * @date       : Created in 2019/11/24
 */
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@Table(name = "total_order")
public class Order extends BaseEntity implements Serializable {

	/**
	 * null
	 * default value: ' '
	 */
	@Column(name = "user_id", nullable = false,length = 255)
	private String userId;

	/**
	 * 收件人
	 * default value: ' '
	 */
	@Column(name = "name", nullable = false,length = 255)
	private String name;

	/**
	 * 联系电话
	 * default value: ' '
	 */
	@Column(name = "phone", nullable = false,length = 255)
	private String phone;

	/**
	 * 收货地址
	 * default value: ' '
	 */
	@Column(name = "addr", nullable = false,length = 255)
	private String addr;

	/**
	 * null
	 * default value: 0
	 */
	@Column(name = "total", nullable = false,length = 50)
	private Double total;

	/**
	 * 备用
	 * default value: ' '
	 */
	@Column(name = "string1", nullable = false,length = 255)
	private String string1;

	/**
	 * 备用
	 * default value: ' '
	 */
	@Column(name = "string2", nullable = false,length = 255)
	private String string2;

	/**
	 * 备用
	 * default value: ' '
	 */
	@Column(name = "string3", nullable = false,length = 255)
	private String string3;

	@Transient
	private List<UserOrder> userOrders;

	public List<UserOrder> getUserOrders() {
		return userOrders;
	}

	public void setUserOrders(List<UserOrder> userOrders) {
		this.userOrders = userOrders;
	}

	public Order() {
		super(); 
		super.status = "1"; 
		super.remark = " ";
		super.gmtCreate = new Date();
		super.gmtModified = new Date();
		this.userId = " ";
		this.name = " ";
		this.phone = " ";
		this.addr = " ";
		this.total = 0.0;
		this.string1 = " ";
		this.string2 = " ";
		this.string3 = " ";
	}
	
	public String getUserId() {
		return this.userId;
	}
	
	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	public String getName() {
		return this.name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getPhone() {
		return this.phone;
	}
	
	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	public String getAddr() {
		return this.addr;
	}
	
	public void setAddr(String addr) {
		this.addr = addr;
	}
	
	public Double getTotal() {
		return this.total;
	}
	
	public void setTotal(Double total) {
		this.total = total;
	}
	
	public String getString1() {
		return this.string1;
	}
	
	public void setString1(String string1) {
		this.string1 = string1;
	}
	
	public String getString2() {
		return this.string2;
	}
	
	public void setString2(String string2) {
		this.string2 = string2;
	}
	
	public String getString3() {
		return this.string3;
	}
	
	public void setString3(String string3) {
		this.string3 = string3;
	}
}
